﻿<%@ Page Title="Quản lí vị trí, chức vụ" Language="C#" MasterPageFile="~/Views/MasterPageViews.master"
    AutoEventWireup="true"
    CodeFile="Postions.aspx.cs" Inherits="Views_Postions" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderChange" runat="Server">
    <h3 class="header-title">
        <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="lblHeader" runat="server"
            Text="Quản lí vị trí, chức vụ" Icon="ApplicationPut" />
    </h3>
    <div class="content-sub">
        <ext:Toolbar ID="ToolbarFunctions" runat="server">
            <Items>
                <ext:Button ID="btnAdd" runat="server" Text="Thêm mới" Icon="Add" OnDirectClick="btnToobarAdd_DirectClick" />
                <ext:Button ID="btnEdit" runat="server" Text="Chỉnh sửa" Icon="Pencil" OnDirectClick="btnToobarUpdate_DirectClick" />
                <ext:Button ID="btnDelete" runat="server" Text="Xóa" Icon="Delete" OnDirectClick="btnToobarDeletes_DirectClick" />
                <ext:Button ID="btnHelp" runat="server" Text="Hỗ trợ" Icon="Help" />
            </Items>
        </ext:Toolbar>
        <ext:Store ID="StorePost" runat="server" OnReadData="StorePost_ReadData" PageSize="30">
            <Sorters>
                <ext:DataSorter Direction="ASC" Property="NameOfPost" />
            </Sorters>
            <Model>
                <ext:Model ID="ModelPost" runat="server" IDProperty="PosID">
                    <Fields>
                        <ext:ModelField Name="PosID" />
                        <ext:ModelField Name="CodePost" />
                        <ext:ModelField Name="NameOfPost" />
                        <ext:ModelField Name="Descriptons" />
                        <ext:ModelField Name="StatusOfPost" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
        <ext:GridPanel ID="GridPanelPost" BodyStyle="background-image: url('../Themes/bg-main.png')" runat="server" StoreID="StorePost" Height="500" Title="Danh sách vị trí, chức vụ">
            <ColumnModel ID="ColumnModelPost" runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumnProvince" Width="30" Text="STT" runat="server" />
                    <ext:Column ID="Col_posID" runat="server" Text="ID" DataIndex="PosID" Hidden="true" />
                    <ext:Column ID="Col_CodeOfPost" runat="server" Text="Mã của vị trí" DataIndex="CodePost" />
                    <ext:Column ID="Col_NameOfPost" runat="server" Text="Tên trình vị trí" DataIndex="NameOfPost"
                        Flex="1" />
                    <ext:Column ID="Col_Descriptons" runat="server" Text="Mô tả của Vị trí" DataIndex="Descriptons" />
                    <ext:CheckColumn ID="Col_StatusOfPost" runat="server" Text="Trạng thái" DataIndex="StatusOfPost" />
                </Columns>
            </ColumnModel>

            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModelPost" runat="server" Mode="Single">
                    <DirectEvents>
                        <Select OnEvent="RowSelected" Buffer="250" />
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbarPost" runat="server" StoreID="StorePost" AfterPageText="của {0}"
                    BeforePageText="Trang" DisplayMsg="Hiển thị  {0} - {1} của {2}" EmptyMsg="Chưa có dữ liệu"
                    FirstText="Trang đầu tiên" LastText="Trang cuối cùng" NextText="Trang kế tiếp"
                    PrevText="Trang trước" RefreshText="Làm mới" />
            </BottomBar>
        </ext:GridPanel>
        <!-- Cửa sổ popup thêm vị trí -->
        <ext:Window ID="windowAddPost" runat="server" Title="Thêm mới vị trí, chức vụ" Icon="Add"
            Height="280" Width="350" BodyStyle="background-image: url('../Themes/bg-main.png')" Modal="true" ShadowMode="Drop"
            Hidden="true">
            <Content>
                <ext:Toolbar ID="ToolbarAddPost" runat="server">
                    <Items>
                        <ext:Button ID="btnWdAddPost" runat="server" Text="Thêm mới" Icon="DiskBlack" OnDirectClick="btnAddPost_DirectClick" />
                        <ext:Button ID="btnWdCancelPost" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnAddCancelPost_DirectClick" />
                    </Items>
                </ext:Toolbar>
                <div class="content-popup-style">
                    <div class="view-msg-popup">
                        <ext:Label ID="lblWindowAddPostMes" runat="server" StyleHtmlContent="True" Icon="None"
                            Cls="lable-message-error" />
                    </div>
                    <div>
                        <ext:TextField ID="txtAddPostCode" runat="server" FieldLabel="Mã" Width="300" MarginSpec="5 0 5 0" />
                        <ext:TextField ID="txtAddPostName" runat="server" FieldLabel="Tên vị trí" Width="300"
                            MarginSpec="5 0 5 0" />
                        <ext:TextArea ID="txtAddPostDes" runat="server" FieldLabel="Mô tả" Width="300" MarginSpec="5 0 5 0" />
                        <ext:Checkbox ID="chkAddStatust" runat="server" FieldLabel="Trạng thái" BoxLabel="Cho phép hoạt động" />
                    </div>
                </div>
            </Content>
        </ext:Window>
        <!-- Cửa sổ popup cập nhật trình độ chuyên môn -->
        <ext:Window ID="windowUpdatePost" runat="server" Title="Cập nhật vị trí, chức vụ" Icon="Add"
            Height="280" Width="350" BodyStyle="background-image: url('../Themes/bg-main.png')" Modal="true" ShadowMode="Drop"
            Hidden="true">
            <Content>
                <ext:Toolbar ID="ToolbarUpdatePost" runat="server">
                    <Items>
                        <ext:Button ID="btnUpdatePost" runat="server" Text="Cập nhật" Icon="DiskBlack" OnDirectClick="btnUpdate_DirectClick" />
                        <ext:Button ID="btnUpdateCancelPost" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnUpdateCancel_DirectClick" />
                    </Items>
                </ext:Toolbar>
                <div class="content-popup-style">
                    <div class="view-msg-popup">
                        <ext:Label ID="lblWindowUpdatePostMsg" runat="server" StyleHtmlContent="True" Icon="None"
                            Cls="lable-message-error" />
                    </div>
                    <div>
                        <ext:TextField ID="txtUpdateCodePost" runat="server" FieldLabel="Mã vị trí" Width="300"
                            MarginSpec="5 0 5 0" />
                        <ext:TextField ID="txtUpdateNamePost" runat="server" FieldLabel="Tên vị trí" Width="300"
                            MarginSpec="5 0 5 0" />
                        <ext:TextArea ID="txtUpdateDesPost" runat="server" FieldLabel="Mô tả" Width="300"
                            MarginSpec="5 0 5 0" />
                        <ext:Checkbox ID="chkUpdateStatus" runat="server" FieldLabel="Trạng thái" BoxLabel="Cho phép hoạt động" />
                    </div>
                </div>
            </Content>
        </ext:Window>
        <%--Hiển thị thôn tin chi tiết--%>
        <div class="view-info-record">
            <h3 class="header-title">
                <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="LabelViewInfomations"
                    runat="server" Text="Hiển thị thông tin vị trí, chức vụ" Icon="Information" />
            </h3>
            <div class="content-info">
                <table>
                    <tr>
                        <td class="with-td-view-info">ID:</td>
                        <td>
                            <ext:Label ID="lblViewID" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="with-td-view-info">Mã vị trí:</td>
                        <td>
                            <ext:Label ID="lblViewCode" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="with-td-view-info">Tên vị trí:</td>
                        <td>
                            <ext:Label ID="lblViewName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="with-td-view-info">Mô tả:</td>
                        <td>
                            <ext:Label ID="lblViewDesc" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="with-td-view-info">Trạng thái:</td>
                        <td>
                            <ext:Checkbox ID="chkViewStatus" runat="server" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</asp:Content>
